Socket
Socket
Sign inDemoInstall

jws

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jws

Implementation of JSON Web Signatures


Version published
Weekly downloads
25M
increased by9%
Maintainers
3
Weekly downloads
 
Created

What is jws?

The jws npm package is a JavaScript implementation for JSON Web Signatures (JWS). It allows you to create, verify, and work with JWSs. This package is useful for implementing security features in applications, such as token-based authentication and data integrity checks.

What are jws's main functionalities?

Signing

This feature allows you to create a JWS by providing a payload, a secret (or private key), and an algorithm. The package will generate a signature that can be used to verify the payload's integrity and authenticity.

{"alg":"HS256","typ":"JWT"}.{"name":"John Doe"}.HMACSHA256(base64UrlEncode(header) + "." + base64UrlEncode(payload), 'secret')

Verification

This feature allows you to verify a JWS signature using the provided secret (or public key) and the algorithm. It returns a boolean indicating whether the signature is valid.

jws.verify(signature, algorithm, secretOrPublicKey)

Decoding

This feature allows you to decode a JWS to extract the header and payload without verifying the signature. This is useful for cases where you need to read the payload without necessarily trusting its source.

jws.decode(signature)

Other packages similar to jws

Keywords

FAQs

Package last updated on 16 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc